<?php
/**
 * 该页面为网站路由
 * 所有路由全部在Route::add，如果要新增继续往后追加即可
 * 对应的格式为
 * '访问路由' => '访问方法'
 */

use system\Route\Route;

Route::add([
    '/'     => '\controllers\home\Index@index',
]);

Route::group('api', function () {
	Route::add([
		'/{m}'     => 'Addons@index', // 访问good模块中的category控制器,index方法  good-category/index
		'/{m}/{a}' => 'Addons@index',
	]);
});

Route::group('/admin', function () {
    Route::add([
        // api
        '/getNavs'                => 'admin\Index@getNavs',
        '/verify'                 => 'admin\Index@verifyCode',
        '/index'                  => 'admin\Index@index',
        '/user/login'             => 'admin\Auth@login',
        '/upload'                 => 'admin\Index@upload',
        '/logs'                   => 'admin\Index@logs',
        '/users'                  => 'admin\SysUsers@index',
        '/users/edit'             => 'admin\SysUsers@edit',
        '/users/delete'           => 'admin\SysUsers@delete',
        '/auth-group'             => 'admin\AuthGroup@index',
        '/site-config'            => 'admin\SiteConfig@index',
        '/site-config/edit'       => 'admin\SiteConfig@edit',
        '/site-config/delete'     => 'admin\SiteConfig@delete',
    ]);

    Route::controller('auth-group', 'admin\AuthGroup');

    Route::group('app', function () {
        Route::add([
            '/{m}'     => 'Addons@index', // 访问good模块中的category控制器,index方法  good-category/index
            '/{m}/{a}' => 'Addons@index',
        ]);
    });
});